int x = 0;

int foo() {
  return 0;
}

void bar() {
  x++;
}

struct A {
  int (*funcptr1)();
  void (*funcptr2)();
};

int (* const gFunc1)() = &foo;
void (* const gFunc2)() = &bar;
const struct A gStruct = { &foo, &bar };

int main() {
  int a = gFunc1();
  int b = gStruct.funcptr1();
  if (a != b) {
    abort();
  }
  gFunc2();
  gStruct.funcptr2();
  if (x != 2) {
    abort();
  }
  (&bar)();
  if (x != 3) {
    abort();
  }
  void (* const lFunc)() = &bar;
  lFunc();
  if (x != 4) {
    abort();
  }
  return 0;
}
